Logic Gates

⭐1. What are Logic Gates?

logic gates.png

Logic Gates are basic building blocks of digital circuits.
They take binary input (0 or 1) and give binary output (0 or 1).

  • Computers
  • Calculators
  • Processors
  • Microcontrollers
  • Digital electronics

⭐2. Types of Logic Gates

Types of Logic Gates.png

There are 7 main logic gates:

✓1. AND Gate

  • Output is 1 only when both inputs are 1
  • Else output is 0
A B Output
0 0 0
0 1 0
1 0 0
1 1 1

✓2. OR Gate

  • Output is 1 if ANY Input is 1
  • Only 0 when both inputs are 0
Truth Table:
A B Output
0 0 1
0 1 1
1 0 1

✓3. NOT Gate (Inverter)

  • Only one input
  • Output is the opposite fo input
  • 0 → 1
  • 1 → 0
Truth Table:
Input Output
0 1
1 0

⭐3. Universal Gates

Universal Gates.png

These gates can create all other gates.

✓4. NAND Gate

  • NOT + AND
  • Output is 0 only when both inputs are 1
  • Otherwise output is 1
Truth Table:
A B Out
0 0 1
0 1 1
1 0 1
1 1 0

✓5. NOR Gate

  • NOT + OR
  • Output is 1 only when both inputs are 0
  • Otherwise output is 0
Truth Table:
A B Out
0 0 1
0 1 0
1 0 0
1 1 0

⭐4. Exclusive Gates

✓6. XOR Gate (Exclusive OR)

  • Output is 1 when inputs are different
  • 0 when inputs are sane
Truth Table:
A B Out
0 0 0
0 1 1
1 0 1
1 1 0

✓7. XNOR Gate (Exclusive NOR)

  • Output is 1 when inputs are same
  • 0 when inputs are different
Truth Table:
A B Out
0 0 1
0 1 0
1 0 0
1 1 1

⭐5. Truth Table Summary (VERY IMPORTANT)

Exclusive Gates.png
Gate Output is 1 when...
AND Both 1
OR At least one 1
NOT Input is 0
NAND NOT(AND)
NOR NOT(OR)
XOR Inputs different
XNOR Inputs same

⭐6. Applications of Logic Gates

Application of Logic Gates.png
  • Calculator circuits
  • CPU and processors
  • ALU (Arithmetic Logic Unit)
  • Control systems
  • Signal processing
  • Digital watches
  • Robotics

⭐7. Important Exam Questions

✓ AND gate output is 1 when? → Both inputs are 1 ✓ Which gate is called inverter? → NOT gate ✓ XOR gate output is 1 when? → Inputs are different ✓ Which gates are universal gates? → NAND and NOR ✓ Output of NAND when A=1, B=1? → 0 ✓ Full form of XOR? → Exclusive OR ✓ XNOR gives 1 when? → Inputs are same